package com.hmdp.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * RedissonConfig
 * @author IT空门_门主
 * @date 2024/6/1
 */
@Configuration
public class RedissonConfig {

    @Bean(name = "redissonClient")
    public RedissonClient redissonClient() {
        Config config = new Config();
        config.useSingleServer()
                /**
                 * 也可以配置集群
                 */
                 //配置单个
                .setAddress("redis://8.130.130.200:63779")
                .setPassword("123456");
        return Redisson.create(config);
    }

}
